﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlImportFromBrand.ascx.cs" Inherits="UserControl_ControlImportFromBrand" %>
<%@ Import Namespace="webapp4U" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<script type="text/javascript">
    function pageLoad() {
       
        $("#<%= imgBtnSave.ClientID %>").click(function () {
                $.blockUI({ css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                    opacity: .5,
                    color: '#fff'
                }
                });
        });
        $("#<%= imgBtnDelete.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        $("#<%= imgBtnFind.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        $("#<%= btSearch.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
        });
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }

</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     <div class="direct_container_right_titletop">
                     Nhận hàng về từ chi nhánh
                </div>
                 <hr />
                <!-- Button chuc nang-->
                <div class="direct_container_main">
                   
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" ImageUrl="~/Images/save.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnDelete" onclick="imgBtnDelete_Click" ImageUrl="~/Images/delete.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnFind" onclick="imgBtnFind_Click" CausesValidation="false" ImageUrl="~/Images/find.png" Width="32px" Height="32px" runat="server" />

                </div>
                <!-- End Button chuc nang-->
                <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial"  Height="500px" 
            Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                 <ContentTemplate>
                     <!-- Content main-->
                <div class="direct_container_main">
                    <div class="direct_container_form_right">
                        <table border="0" width="100%">
                            <tr>
                                <td width="14%" align="right"><p class="direct_label">Số chứng từ</p></td>
                                <td width="86%" align="left">
                                <asp:TextBox ID="txtSoChungTuNhapHang" ReadOnly="True" CssClass="input_code" 
                                        runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right"><p class="direct_label">Ngày</p></td>
                                <td align="left">
                                 <asp:TextBox ID="txtDate" CssClass="input_code" runat="server"></asp:TextBox>
                                </td>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Chọn kho</p>
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddrLocation" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Số chứng từ xuất hàng</p>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtSoChungTuXuatHang" runat="server" CssClass="input_code" 
                                            ReadOnly="True"></asp:TextBox>
                                        <asp:Button ID="btnChon" runat="server" onclick="btnChon_Click" Text="Chọn" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                      <asp:GridView ID="grvProduct" runat="server" AutoGenerateColumns="False"    EnableModelValidation="True">
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="STT">
                                                                <HeaderTemplate>
                                                                    STT
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Mã hàng">
                                                                <HeaderTemplate>
                                                                    Mã hàng
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("mItemKey")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Tên hàng">
                                                                <HeaderTemplate>
                                                                    Tên hàng
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("mItemDesc")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Số lượng">
                                                                <HeaderTemplate>
                                                                    Số lượng
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("mQty")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Đơn giá">
                                                                <HeaderTemplate>
                                                                    Đơn giá
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("mCost")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            
                                                        </Columns>
                                      </asp:GridView>
                                        
                                        </td>
                                </tr>
                            </tr>
                        </table>
                    </div>
                </div>
                <!-- EndContent main-->
                 </ContentTemplate>
            </cc1:TabPanel>
             <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                         <!-- Content search-->
                <div class="direct_container_main">
                    <div class="direct_container_form_right">
                          <table border="0" width="100%">
                                <tr><td colspan="2"><p class="direct_legend">Nhập thông tin cần tìm</p></td></tr>
                                <tr>
                                    <td colspan="2" valign="middle">
                                  
                                        <asp:Button ID="btSearch" CssClass="direct_bt_search" runat="server" 
                                            Text="Tìm kiếm" onclick="btSearch_Click" />
                                    </td>
                                    <tr>
                                        <td colspan="2">
                                        
                                        <asp:GridView ID="grvSearch" runat="server" PageSize="10" AutoGenerateColumns="False" 
                                                        DataKeyNames="productkey" EnableModelValidation="True" onpageindexchanging="grvSearch_PageIndexChanging" 
                                                        onrowcommand="grvSearch_RowCommand">
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Stt">
                                                                <HeaderTemplate>
                                                                    STT
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Mã chứng từ nhập hàng">
                                                                <HeaderTemplate>
                                                                   Mã chứng từ xuất hàng
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                   
                                                                    <asp:Label ID="lblMaSoChungTuNhapHang" runat="server" Text='<%# Eval("docno")%>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Ngày">
                                                                <HeaderTemplate>
                                                                    Ngày
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("docDate")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Mã chứng từ xuất hàng">
                                                                <HeaderTemplate>
                                                                   Mã chứng từ xuất hàng
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("SONo")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField>
                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="20px" ImageUrl="~/Images/check.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" BorderColor="White" />
                                                                <FooterStyle BackColor="White" BorderColor="White" />
                                                                <HeaderStyle BackColor="White" BorderColor="White" />
                                                                <ItemStyle BackColor="White" BorderColor="White" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                        
                                        </td>
                                    </tr>

                                </tr>
                         </table>
                    </div>

                </div>
                <!-- End Content search-->
                </ContentTemplate>
            </cc1:TabPanel>
            </cc1:TabContainer>
    </ContentTemplate>
</asp:UpdatePanel>
<uc1:uscMsgBox ID="uscMsgBox1" runat="server" />
